Skip to content

Fix CUDA tensor to numpy conversion error in apply_grappa_kernel#10

Open
ramintoosi wants to merge 1 commit into
mind-inria:mainfrom
ramintoosi:main
Open

Fix CUDA tensor to numpy conversion error in apply_grappa_kernel#10
ramintoosi wants to merge 1 commit into
mind-inria:mainfrom
ramintoosi:main

Conversation

@ramintoosi

Copy link
Copy Markdown

When sig is on CUDA, nonzero()[0] returns a CUDA tensor.
Unpacking it into shift_y, shift_z gives CUDA scalars, which
then fail when added to a numpy array on line 84 (zival = cnt + z_ival).

Fix: add .cpu() to move the tensor to CPU before unpacking.

Reproduces with any CUDA input when cuda=True or cuda_mode="all".

@ramintoosi ramintoosi changed the title Fix CUDA tensor to numpy conversion error in apply_grappa_kerne Fix CUDA tensor to numpy conversion error in apply_grappa_kernel Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant